package yi.numberSeven;

import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;

public class NumberSeven {
    public static void main(String[] args) {
        List<String> list=new ArrayList<>();
        try(
                BufferedReader bufferedReader=new BufferedReader(new FileReader("g:/file/Task2.txt"))
                ) {
            String s = null;
            while ((s=bufferedReader.readLine())!=null){
                list.add(s);
            }
        }catch (IOException e){
            e.printStackTrace();
        }
        List<Student> collect = list.stream()
                .map(s -> {
                    String[] split = s.split(",");
                    return new Student(split[0], split[1], Integer.valueOf(split[2]), Integer.valueOf(split[3]));
                }).collect(Collectors.toList());
        collect.forEach(System.out::println);

    }
}
